<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>VUE模板语法-插值-属性</title>
        <style type="text/css">
            .red {
                color: red
            }
        </style>
        <script type="text/javascript" src="https://unpkg.com/vue/dist/vue.js"></script>
    </head>
    <body>
        <div id="app">
            <input type="checkbox" v-model="redFlag" id="r1"/>
            <br/>
            <div v-bind:class="{'red': redFlag}">ABCDEFG</div>
        </div>
    </body>
    <script type="text/javascript">
        var vueObj = new Vue({
            el: '#app',
            data: {
                redFlag: true
            }
        });
    </script>
</html>